// MemoryOverload.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "ObjectBase.h"

#include <crtdbg.h>


void TestObjectBase() 
{
	ObjectBase o1;
	ObjectBase o2 = o1;

	ObjectBase *p1 = NULL;
	p1 = new ObjectBase();

	*p1 = o1;

	delete p1;
	
	p1 = NULL;

	// im sooo bad
	//*p1 = o1;

}

void CheckMemory() 
{
	if (_CrtDumpMemoryLeaks())
		printf("!!!Memory LEAK PANIC!!!");
	if (!_CrtCheckMemory())
		printf("!!!Memory CHECK PANIC!!!");
}

int _tmain(int argc, _TCHAR* argv[])
{
	TestObjectBase();
	CheckMemory();
	return 0;
}

